package com.niguang.work.labour.api.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.niguang.work.labour.api.entity.AppUser;
import com.niguang.work.labour.api.service.IcCardService;
import com.niguang.work.labour.common.pojo.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;

@RestController
@RequestMapping("/iccard/face/")
public class IcCardController {
    @Resource
    IcCardService icCardService;

    /**
     * 绑定icCard-----同步会员信息
     *
     * @param
     * @return
     */
    @PostMapping(value = "bindIcCardInfo")
    public Result bindIcCardInfo(@NotNull @RequestParam Long userId, @NotNull @RequestParam String siteId, @NotNull @RequestParam String icCard) {
        return icCardService.bindIcCardInfo(userId, siteId, icCard);
    }


    /**
     * 解除绑定
     * @param userId
     * @param siteId
     * @param icCard
     * @return
     */
    @PostMapping("/unbindIcCardInfo")
    public Result unbindIcCardInfo(@NotNull @RequestParam Long userId, @NotNull @RequestParam String siteId, @NotNull @RequestParam String icCard) {
       return  icCardService.unbindIcCardInfo(icCard,siteId,userId);
    }
}
